<template>
  <div>
    <van-nav-bar left-arrow />
    <h3 class="title">短信登录</h3>
    <van-form @submit="onSubmit">
      <van-field
        v-model="username"
        name="用户名"
        placeholder="请输入手机号"
        :rules="[{ required: true, message: '请输入手机号' }]"
      />
      <van-field
        v-model="sms"
        center
        clearable
        placeholder="请输入验证码"
        :rules="[{ required: true, message: '请输入验证码' }]"
      >
        <template #button>
          <van-button size="small" >发送验证码</van-button>
        </template>
      </van-field>
      <div style="margin: 16px">
        <van-button  block type="info" native-type="submit"
          >提交</van-button
        >
      </div>
    </van-form>
  </div>
</template>

<script>
export default {
  name: 'LoginPage',
  data () {
    return {
      username: '',
      password: ''
    }
  },
  methods: {
    onSubmit (values) {
      console.log('submit', values)
    }
  }
}
</script>

<style>
.title {
  font-size: 22px;
  line-height: 1;
  padding: 30px 32px;
}
</style>
